package com.lotter.common.enumobject;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

/**
 * 是否中奖
 * @author cool
 *
 */
public enum IswinningEnum {

	
	CLOSE_WINNING(1, "未开奖"), ALREADY_WINNING(2, "已中奖"),NOT_WINNING(3, "未中奖");

	private int code;

	private String desc ;
	

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	private IswinningEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static String toJSONString(){
		JSONArray array = new JSONArray();
		JSONObject object = null;
		IswinningEnum[] iswinningEnum = IswinningEnum.values();
		for (IswinningEnum iswin : iswinningEnum) {
			object = new JSONObject();
			object.put(iswin.getCode()+"", iswin.getDesc());
			array.add(object);
		}
		return JSON.toJSONString(array);
	}
	
}
